package com.zhentao.datacontrol.domain.entity;

import com.baomidou.mybatisplus.annotation.*;

import java.time.LocalDateTime;

@TableName("dc_execution_log")
public class ExecutionLog {

    @TableId(type = IdType.AUTO)
    private Long id;

    private String executionId;
    private Long ruleId;
    private String ruleCode;

    // 执行信息
    private String executionType; // AUTO, MANUAL
    private String executionStatus; // RUNNING, SUCCESS, FAILED

    // 数据统计
    private Integer totalRecords;
    private Integer checkedRecords;
    private Integer errorRecords;
    private Integer warningRecords;

    // 执行时间
    private LocalDateTime startTime;
    private LocalDateTime endTime;
    private Integer durationSeconds;

    // 错误信息
    private String errorMessage;
    private String executionDetails; // JSON格式

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createdTime;

    // 非数据库字段
    @TableField(exist = false)
    private String ruleName;

    @TableField(exist = false)
    private String executionTypeText;

    @TableField(exist = false)
    private String executionStatusText;

    @TableField(exist = false)
    private String durationText;

    // Getters and Setters
    public Long getId() { return id; }
    public void setId(Long id) { this.id = id; }

    public String getExecutionId() { return executionId; }
    public void setExecutionId(String executionId) { this.executionId = executionId; }

    public Long getRuleId() { return ruleId; }
    public void setRuleId(Long ruleId) { this.ruleId = ruleId; }

    public String getRuleCode() { return ruleCode; }
    public void setRuleCode(String ruleCode) { this.ruleCode = ruleCode; }

    public String getExecutionType() { return executionType; }
    public void setExecutionType(String executionType) { this.executionType = executionType; }

    public String getExecutionStatus() { return executionStatus; }
    public void setExecutionStatus(String executionStatus) { this.executionStatus = executionStatus; }

    public Integer getTotalRecords() { return totalRecords; }
    public void setTotalRecords(Integer totalRecords) { this.totalRecords = totalRecords; }

    public Integer getCheckedRecords() { return checkedRecords; }
    public void setCheckedRecords(Integer checkedRecords) { this.checkedRecords = checkedRecords; }

    public Integer getErrorRecords() { return errorRecords; }
    public void setErrorRecords(Integer errorRecords) { this.errorRecords = errorRecords; }

    public Integer getWarningRecords() { return warningRecords; }
    public void setWarningRecords(Integer warningRecords) { this.warningRecords = warningRecords; }

    public LocalDateTime getStartTime() { return startTime; }
    public void setStartTime(LocalDateTime startTime) { this.startTime = startTime; }

    public LocalDateTime getEndTime() { return endTime; }
    public void setEndTime(LocalDateTime endTime) { this.endTime = endTime; }

    public Integer getDurationSeconds() { return durationSeconds; }
    public void setDurationSeconds(Integer durationSeconds) { this.durationSeconds = durationSeconds; }

    public String getErrorMessage() { return errorMessage; }
    public void setErrorMessage(String errorMessage) { this.errorMessage = errorMessage; }

    public String getExecutionDetails() { return executionDetails; }
    public void setExecutionDetails(String executionDetails) { this.executionDetails = executionDetails; }

    public LocalDateTime getCreatedTime() { return createdTime; }
    public void setCreatedTime(LocalDateTime createdTime) { this.createdTime = createdTime; }

    public String getRuleName() { return ruleName; }
    public void setRuleName(String ruleName) { this.ruleName = ruleName; }

    public String getExecutionTypeText() { return executionTypeText; }
    public void setExecutionTypeText(String executionTypeText) { this.executionTypeText = executionTypeText; }

    public String getExecutionStatusText() { return executionStatusText; }
    public void setExecutionStatusText(String executionStatusText) { this.executionStatusText = executionStatusText; }

    public String getDurationText() { return durationText; }
    public void setDurationText(String durationText) { this.durationText = durationText; }
}
